package nautilus.tank.model;

import java.util.ArrayList;
import java.util.List;

public class Player {
	private String name;
	private List<IVehicleWeapon> weapons = new ArrayList<IVehicleWeapon>();
	private int selectedItemIdx;
	
	public Player(){
		name = "NONAME";
		selectedItemIdx = -1;
		
		//for testing
		//Tank tank = new Tank("D:\\Projects\\my-tank-game\\artwork\\tank4.png");
		Tank tank = new Tank("tank4.png");
		tank.setY(300);
		tank.setX(590);
		//tank.setDirection(2.0f);
		weapons.add(tank);
		tank = new Tank("tank6.png");
		tank.setSpeed(95);
		weapons.add(tank);
		tank.setX(500);
	}
	
	public void setName(String name){
		this.name = name;
	}
	
	public String getName(){
		return name;
	}
	
	public List<IVehicleWeapon> getVehicles(){
		return weapons;
	}
	
	public void addWeapon(IVehicleWeapon wp){
		weapons.add(wp);
	}
	
	public void removeWeapon(IVehicleWeapon wp){
		weapons.remove(wp);
	}
	
	public IVehicleWeapon getSelectedWeapon(){
		return weapons.get(selectedItemIdx);
	}
}
